package mn.slide.laborberlin.verlauf;

import mn.slide.laborberlin.adaptor.MerklisteAdapter;
import mn.slide.laborberlin.db.DataLayer;
import mn.slide.laborberlin.main.R;
import mn.slide.laborberlin.model.UnterSuchung;
import mn.slide.laborberlin.tabgroup.GroupStarter;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class VerlaufActivity extends Activity
{
	ListView					marListView;
	ArrayAdapter<UnterSuchung>	adaptor;

	@Override
	protected void onCreate( Bundle savedInstanceState )
	{
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.verlauf);
		marListView = (ListView) findViewById(R.id.verLV);
		View footerView = ((LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.merklist_header, null, false);
		marListView.addHeaderView(footerView);
		TextView header = (TextView) findViewById(R.id.header_title);
		header.setText(R.string.verlauf);
		adaptor = new MerklisteAdapter(this, DataLayer.layer.getVerllist());
		marListView.setAdapter(adaptor);
	}

	@Override
	protected void onResume()
	{
		// TODO Auto-generated method stub
		super.onResume();
		adaptor.notifyDataSetChanged();
	}

	@Override
	public void onBackPressed()
	{
		GroupStarter.getInstance().onBackpressed(this);
	}
}
